import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String a = scan.nextLine();
        String b = scan.nextLine();
        int sum = 0 ;
        for(int i = 0 ; i < b.length(); i ++){
            int j = 0 ;
            int tmp = 0 ;
            if(b.charAt(i) == a.charAt(0)){
                for(; j < a.length() && i + j < b.length(); j ++){
                    if(a.charAt(j) != b.charAt(i + j)){
                        tmp ++ ;
                    }
                }
                while(j < a.length()){
                    j ++ ;
                    tmp ++ ;
                }
            }
            if(tmp > sum ){
                sum = tmp ;
            }
        }

        System.out.println(sum);

    }
}
